package com.imut.iot;
import java.util.Arrays;
import java.util.Comparator;

public class Main {

	public static void main(String[] args) {
		
		Student[] students = new Student[3];
		
		students[0] = new Student("ZhangSan",22);
		students[1]= new Student("LiSi",21);
		students[2]= new Student("WangWu",18);
		
//		Arrays.sort(students, new Comparator<Student>(){
//
//			@Override
//			public int compare(Student o1, Student o2) {
//				
//				return o1.getAge()-o2.getAge();
//			}});
		
		
//		for(int i=0;i<students.length;i++) {
//			
//			System.out.println(students[i]);
//			
//		}
		
		
		Queue q = new Queue();
		
		q.push(students[2]);
		q.push(students[1]);
		q.push(students[0]);
		q.push(5.5f);
		
		
		System.out.println(q.pop());
		System.out.println(q.pop());
		System.out.println(q.pop());
		System.out.println(q.pop());
		System.out.println(q.pop());
		System.out.println(q.pop());
		System.out.println(q.pop());
		
		
		AQueue aqueue = new AQueue(10);
		
		aqueue.push(0);
		aqueue.push(1);
		aqueue.push(3);
		aqueue.push(7);
		aqueue.push(0);
		aqueue.push(1);
		aqueue.push(3);
		aqueue.push(7);
		aqueue.push(0);
		aqueue.push(1);
		aqueue.push(3);
		aqueue.push(7);
		
		System.out.println(aqueue.pop());
		System.out.println(aqueue.pop());	
		System.out.println(aqueue.pop());	
		System.out.println(aqueue.pop());
		System.out.println(aqueue.pop());
		System.out.println(aqueue.pop());
		System.out.println(aqueue.pop());
		System.out.println(aqueue.pop());	
		System.out.println(aqueue.pop());	
		System.out.println(aqueue.pop());
		System.out.println(aqueue.pop());
		System.out.println(aqueue.pop());
		System.out.println(aqueue.pop());
		System.out.println(aqueue.pop());	
		System.out.println(aqueue.pop());	
		System.out.println(aqueue.pop());
		System.out.println(aqueue.pop());
		System.out.println(aqueue.pop());
		
	}

}
